package com.one.rope.mvp.web.business.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.one.rope.mvp.web.business.entity.MemberIntentionLog;
import com.one.rope.mvp.web.business.dao.MemberIntentionLogMapper;
import com.one.rope.mvp.web.business.service.IMemberIntentionLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.one.rope.mvp.web.common.dto.admin.intention.AdminIntentionListDTO;
import com.one.rope.mvp.web.common.dto.admin.intention.AdminIntentionListItemVO;
import com.one.rope.mvp.web.common.dto.admin.intention.AdminIntentionListVO;
import com.one.rope.mvp.basecore.bean.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户意向记录表 服务实现类
 * </p>
 *
 * @author wesley
 * @since 2020-02-20
 */
@Service
public class MemberIntentionLogServiceImpl extends
    ServiceImpl<MemberIntentionLogMapper, MemberIntentionLog> implements
    IMemberIntentionLogService {

  @Autowired
  MemberIntentionLogMapper memberIntentionLogMapper;

  @Override
  public ResponseObject intentionList(AdminIntentionListDTO reuestDTO) {
    AdminIntentionListVO resultVO = new AdminIntentionListVO();
    Page<AdminIntentionListItemVO> page = new Page<>(reuestDTO.getPageNo(),
        reuestDTO.getPageSize());
    List<AdminIntentionListItemVO> recordList = memberIntentionLogMapper
        .selectIntentionLogListByPage(page, reuestDTO);

    resultVO.setResults(recordList);
    resultVO.initPageInfo(page);
    return new ResponseObject(resultVO);
  }
}
